#include "Delay.h"
#include <stm32f10x.h>

/**************************
 *内部延时
 ***************************/

/*---------------------------------
延时us
-----------------------------------*/
void Delay_us(unsigned long u32us)
{
    unsigned char i;

    while (u32us--) {
        for (i = 0; i < 3; i++)
            ;
    }
}

void Delay05us(void)
{
    unsigned char i;
    for (i = 0; i < 1; i++)
        ;
}

static volatile uint32_t TimingDelay = 0;

void Delay_sys(volatile unsigned long nTime)
{
    TimingDelay = nTime;

    while (TimingDelay != 0)
        ;
}

void TimingDelay_Decrement(void)
{
    if (TimingDelay != 0x00) {
        TimingDelay--;
    }
}
